# -*- codeing = utf-8 -*-
# @Time : 2022/12/21 20:44
# @Author : 小马
# @File: Adc.py
# @Software : PyCharm
import random

import pygame
class Sun(pygame.sprite.Sprite):
    def __init__(self,rect):
        super(Sun,self).__init__()
        self.image=pygame.image.load('material/sun1.png').convert_alpha()
        self.images = [pygame.image.load('material/sun{:d}.png'.format(i)).convert_alpha() for i in range(1, 2)]
        self.rect=self.images[0].get_rect()

        offsetTop=random.randint(-50,50)
        offsetLeft=random.randint(-50,50)

        self.rect.top=rect.top+offsetTop
        self.rect.left=rect.left+offsetLeft
    def update(self,*args):
        self.image=self.images[args[0]%len(self.images)]